package com.baizhi.service.imp;

import com.baizhi.service.BannerService;
import com.baizhi.dao.BannerDao;
import com.baizhi.entity.Banner;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BannerServiceImp implements BannerService {

    @Resource
    private BannerDao bannerDao;

    @Override
    public List<Banner> findAll() {
        return bannerDao.selectAll();
    }

    @Override
    public Banner findBannerByField(Banner banner) {
        return bannerDao.selectBannerByField(banner);
    }

    @Override
    public void addBanner(Banner banner) {
        bannerDao.insertBanner(banner);
    }

    @Override
    public void removeBannerById(Integer bannerId) {
        bannerDao.deleteBannerById(bannerId);
    }

    @Override
    public void removeMultiple(Integer[] ids) {
        bannerDao.deleteMultiple(ids);
    }

    @Override
    public void renovateBanner(Banner banner) {
        bannerDao.updateBanner(banner);
    }
}
